import React from 'react'
import {ProductCard } from 'react-vant';
import {
    useNavigate //跳路由的方法
} from "react-router-dom"

function Tab_contents({val}) {
    const navigate = useNavigate()
    
    const gotodetail = (val) =>{
        console.log(val);
        // navigate("/detail/"+ val.id )
        navigate(`/detail/${val.id}`,{state:val})
    }
    return (
        <div>
            <ProductCard
                onClick={()=>gotodetail(val)}
                num={val.count}
                price={val.price}
                desc="描述信息"
                title={val.title}
                thumb={val.img}
                />
        </div>
    )
}

export default Tab_contents
